
import { getToken,getCache } from "@/utils/cache";
import Keys from '@/utils/constant/keys'
export interface UserState {
    token: string
    roles: Array<any>[]
    user: any;
    permissions: Array<string>[],
    company: any,
    menus: Array<any>[],
    ossConfig: any
}

export const state: UserState = {
    token: getToken() || '',
    roles: getCache(Keys.roleKey, 's') || [],
    user: getCache(Keys.userInfoKey, 's') || {},
    permissions:getCache(Keys.permissionKey, 's') || [],
    company: getCache(Keys.companyKey,'s') || {},
    menus: getCache(Keys.menuKey,'s') || [],
    ossConfig: {},
}
